//
// Created by Cammy on 2024/4/24.
//
#include "BidList.c"

int TestList01() {
    BidListNode *plist = ListInit();
//    ListPushBack(plist,7);
//    ListPushBack(plist,7);
//    ListPushBack(plist,7);
//    ListPushBack(plist,7);
//    ListPrint(plist);

    ListPushFront(plist, 1);
    ListPushFront(plist, 2);
    ListPushFront(plist, 3);
    ListPrint(plist);

//    ListPopFront(plist);
//    ListPopFront(plist);
//    ListPopFront(plist);
    ListPopBack(plist);
    ListPopBack(plist);
    ListPopBack(plist);
    ListPrint(plist);

    ListPopFront(plist);


    ListDestroy(plist);
}

int TestList02() {
    BidListNode *plist = ListInit();
    ListPushBack(plist, 1);
    ListPushBack(plist, 27);
    ListPushBack(plist, 3);
    ListPushBack(plist, 5);
    ListPrint(plist);
    BidListNode *pos = ListFind(plist, 3);
//    if(pos){
////        pos->data*=20;
//// 查找附带着修改的作用
//        printf("Find...\n");
//    }else{
//        printf("No Find...\n");
//    }
    ListErase(pos);
    ListPrint(plist);

    pos = ListFind(plist, 27);
    ListInsert(pos, 3);
    ListPrint(plist);

    int size = Size(plist);
    printf("%d", size);

    ListDestroy(plist);
}

int main() {
    TestList01();
//    TestList02();
    return 0;
}
